Energy flow measurement in gas pipelines

ABSTRACT

Thermodynamic properties of a natural gas stream can be determined in real time utilizing modeling algorithms in conjunction with one or more sensors for quantifying physical and chemical properties of the natural gas. Related techniques, apparatus, systems, and articles are also described.

RELATED APPLICATIONS

The present application is a divisional of U.S. patent application Ser.No. 11/945,985, filed on Nov. 27, 2007 and entitled “Energy FlowMeasurement In Gas Pipelines,” now issued as U.S. Pat. No. 7,653,497,and also claims priority to U.S. Provisional Application Ser. No.60/930,449, filed on May 15, 2007 and entitled “BTU Measurement in GasPipelines” which is incorporated by reference herein in its entirety.

TECHNICAL FIELD

The subject matter described herein relates to measurement of energycontent flow in gas pipelines.

BACKGROUND

Recent deregulation and subsequent open access to the natural gaspipeline industry has strongly encouraged or, in some cases, forced gasbusinesses toward greater reliance on local energy flow ratemeasurement. What was once a large, stable, and well-defined source ofnatural gas is now a composite of many small suppliers with greatlyvarying gas compositions or involved with gas blending operations. Whilenatural gas still has many advantages and its usage is increasing, it isno longer the inexpensive source of energy that it once was.Under-billing at tariff transfer points can cause revenue losses whileover-billing can require accounts receivable corrections that can resultin sizable additional costs.

One currently available approach to energy flow measurement uses a gaschromatograph (GC) for composition assay in conjunction with a flowmeter. Such measurements are generally cost effective only for largecapacity supplies (typically in applications where the volume is on theorder of 1 to 30 million scf/day). The capital and the high maintenancecosts of GC-based analysis systems can prevent their use in manyapplications. GC analysis can also be limited to measurements of onlyclean dry natural gas free of liquids or other contaminants that canfoul the GC column. Such conditions are generally not present in anatural gas pipeline. GC systems can also suffer from slow analysis andcalculation rates, with a typical analysis cycle requiring four or moreminutes of sampling and analysis time. Natural gas moving at a pipelinevelocity of 25 ft/sec travels over a mile in four minutes. Thus, acalculation of energy content flow based on GC measurements will in someapplications be representative of gas that is already a mile or fartherdown the pipeline. Operation and maintenance costs of operating GCs canalso be quite large due to the required consumable carrier gases and theregular maintenance required to assure that the instrument will continueto provide accurate data.

Another alternative method for measuring the potential energy of naturalgas in a pipeline is calorimetry. The flame calorimeter is used tomeasure the properties of gas reactions. The gases concerned are fed ata known, constant rate to a jet at which the reaction occurs. Thereaction chamber and gas pipes are contained in a thermostaticallycontrolled water bath to ensure constant temperature. The reaction isthen started and the temperature rise measured after a known amount ofgas has been fed into the reaction. Calibration of the calorimeter,either with a standard reaction or by electrical means, allowscalculation of the enthalpy (ΔH) of the reaction because the reaction isconducted at constant pressure. Flame calorimetry can be performed innear real time depending on the design of the device employed. However,if the heated mass has a large heat capacity, it will take longer toregister a meaningful temperature shift which results in a delay. Inaddition, calorimeter design is very difficult, especially for processesinvolving very small energy changes, e.g., energy changes on top of alarge background such as pipeline gas. Maintenance and calibration ofthese devices may also require considerable resources.

SUMMARY

In one implementation of the current subject matter, an apparatusincludes a first spectroscopic sensor that measures absorption of carbondioxide in a gas stream and produces a first data signal characterizinga carbon dioxide concentration in the gas stream; a second spectroscopicsensor that measures absorption of hydrocarbons in the gas stream andproduces a second data signal characterizing a total hydrocarbonconcentration in the gas stream; and one or more third sensors producingone or more third data signals characterizing a temperature, a pressure,and a velocity of sound in the gas stream. The first, second, and thirddata signals are received by a master processor that implements analgorithm that determines an energy content of the gas stream using asinputs the carbon dioxide concentration, the total hydrocarbonconcentration, the temperature, the pressure, and the velocity of soundcharacterized in the first, second, and third data signals.

In a second interrelated implementation, a first data signalcharacterizing a carbon dioxide concentration in a gas stream isreceived from a first spectroscopic sensor; a second data signalcharacterizing a total hydrocarbon concentration in the gas stream isreceived from a second spectroscopic sensor; and one or more third datasignals characterizing a temperature, a pressure, and a velocity ofsound in a gas stream are received from one or more third sensors. Analgorithm is implemented that determines an energy content of the gasstream using as inputs the temperature, pressure, velocity of sound,carbon dioxide concentration, and hydrocarbon concentrationcharacterized in the first, second, and third data signals.

In a third interrelated implementation, an apparatus includes a firstsensor producing a first data signal characterizing a carbon dioxideconcentration in the gas stream. The first sensor includes a tunablediode laser absorption spectrometer that measures carbon dioxideabsorption at an effective wavelength to determine a carbon dioxideconcentration in the gas stream. A master processor receives the firstdata signal and measurements of pressure and temperature in the gasstream. The master processor implements an algorithm that determines anenergy content of the gas stream using as inputs the measuredtemperature, pressure, and carbon dioxide concentration, the algorithminferring a total hydrocarbon concentration in the gas stream based on adatabase of characteristic natural gas concentrations.

In optional variations, the master processor can determine the carbondioxide concentration in the gas stream based on the first data signal,determine the total hydrocarbon concentration based on the second datasignal, and calculate a total nitrogen and inert species concentrationin the gas stream as the remainder when the carbon dioxide and totalhydrocarbon concentrations are subtracted from 100%. An apparatus canalso optionally include one or more connections configured to attach toa fitting on a gas pipeline to divert the sample gas stream from the gaspipeline to the first, second, and third sensors. The one or more thirdsensors can optionally include an ultrasonic meter. The first sensor canoptionally include a tunable diode laser absorption spectrometer thatmeasures carbon dioxide absorption at an effective wavelength todetermine a carbon dioxide concentration in the gas stream. Theeffective wavelength can optionally be in a range of approximately 2003to 2004 nm. The second data signal can optionally include an absorptionmeasurement measured at a single wavelength or in a single wavelengthscan of a tunable diode laser and wherein the master processor uses theabsorption measurement to calculate the total hydrocarbon concentrationin the gas stream. The second sensor can also or alternativelyoptionally include a laser absorption spectrometer operating at ahydrocarbon characterization wavelength at which a total absorbance forhydrocarbons having fewer than 10 carbon atoms over an absorption pathlength of at least 10 cm is within a range of approximately 0.01% and10.0% and the standard deviation of absorbances for the hydrocarbonshaving fewer than 10 carbon atoms is less than approximately 11%. Thehydrocarbon characterization wavelength can optionally one of 2275.82nm, 2270.31 nm, 2268.32 nm, 2262.10 nm, 2261.30 nm, 2261.15 nm, 2260.99nm, 2260.87 nm, 2260.84 nm, 2260.32 nm, 2260.04 nm, 1694.05 nm, and1694.02 nm.

In other optional variations, the second sensor can include a tunablediode laser absorption spectrometer that measures methane absorption ata first effective wavelength to determine a methane concentration in thegas stream and a laser absorption spectrometer operating at ahydrocarbon characterization wavelength at which a total hydrocarbonabsorbance for hydrocarbons having between 2 and 10 carbon atoms over anabsorption path length of at least 10 cm is within a range ofapproximately 0.01 and 10.0. The standard deviation of absorbances forthe hydrocarbons having between 2 and than 10 carbon atoms canoptionally be less than approximately 20%, and a methane absorbance fora 90% mole fraction of methane can optionally be less than approximately1% of the total hydrocarbon absorbance for a 10% mole fraction of allC2-C10 absorptions at the path length of 10 cm.

The second sensor can also or alternatively optionally include a laserabsorption spectrometer operating at a hydrocarbon characterizationwavelength at which a total hydrocarbon absorbance for hydrocarbonshaving between 2 and 10 carbon atoms over an absorption path length ofat least 10 cm is within a range of approximately 0.01 and 10.0. Thestandard deviation of absorbances for the hydrocarbons having between 2and than 10 carbon atoms can optionally be less than approximately 20%,and a methane absorbance for a 90% mole fraction of methane canoptionally be less than approximately 1% of the total hydrocarbonabsorbance for a 10% mole fraction of all C2-C10 absorptions at the pathlength of 10 cm. The hydrocarbon wavelength can optionally be one of3081.95 nm, 3082.23 nm, 3082.29 nm, 3082.35 nm, 3082.40 nm, 3082.46 nm,3082.52 nm, 3083.78 nm, 3083.84 nm, 3083.89 nm, 3084.52 nm, 3084.58 nm,3084.64 nm, 3084.70 nm, 3084.75 nm, 3084.81 nm, 3084.87 nm, 3084.93 nm,3085.10 nm, 3085.15 nm, 3085.21 nm, 3087.16 nm, 3087.22 nm, 3087.28 nm,3087.34 nm, 6718.02 nm, 6718.83 nm, 6731.37 nm, 6731.64 nm, and 6731.92nm.

Computer program products, which may be embodied on computerreadable-material, are also described. Such computer program productsmay include executable instructions that cause a computer system toconduct one or more of the method acts described herein. Similarly,computer systems are also described that may include a processor and amemory coupled to the processor. The memory may encode one or moreprograms that cause the processor to perform one or more of the methodacts described herein.

Among other possible advantages, the subject matter described herein maybe used to reduce capital and “operating and maintenance” (O&M) costs ofnatural gas energy content measurements in pipelines while alsoimproving reliability, speed and accuracy. Energy producers and usersmay benefit from tighter gas inventory control, more efficient pipelineand industrial plant operations, and ultimately lower costs to theconsumer. Suppliers have a need to monitor their product to assure thatthey are providing accurate measures of energy and consumers need toverify that their suppliers are giving correct measures.

The details of one or more variations of the subject matter describedherein are set forth in the accompanying drawings and the descriptionbelow. Other features and advantages of the subject matter describedherein will be apparent from the description and drawings, and from theclaims.

DESCRIPTION OF THE DRAWINGS

This disclosure may be better understood upon reading the detaileddescription and by reference to the attached drawings, in which:

FIG. 1 is a process flow diagram showing a method of measuring theenergy content of a gas stream;

FIG. 2 is a diagram showing components of an energy meter;

FIG. 3 is a diagram illustrating operation of an algorithm fordetermining the energy content of a gas stream;

FIG. 4 is a graph showing absorption spectra for hydrocarbons havingbetween one and ten carbons at wavelengths near 2.269 μm;

FIG. 5 is a graph showing absorption spectra for hydrocarbons havingbetween one and ten carbons at wavelengths near 2.261 μm;

FIG. 6 is a graph showing absorption spectra for hydrocarbons havingbetween one and ten carbons at wavelengths near 2.276 μm; and

FIG. 7 is a graph showing absorption spectra for hydrocarbons havingbetween one and ten carbons at wavelengths near 1.694 μm.

Like reference symbols may refer to like elements.

DETAILED DESCRIPTION

The disclosed subject matter includes methods, techniques, systems,structures, and articles of manufacture that may be used to determinethermodynamic properties of a natural gas stream in real time usingmodeling algorithms and one or more sensors that measure physical andchemical properties of the natural gas stream. Such devices and systemscan produce and process all information about the gas stream necessaryto obtain a measurement of the energy content of the gas in real timewithout depending on database representations of standard streamconstituent mixtures. To determine a sufficient set of natural gascharacteristics to compute the energy content of the gasalgorithmically, the velocity of sound in the gas is generally neededalong with gas temperature and gas pressure, and one or the other ofCO₂+N₂ or CO₂+total HC (from which the N₂ content can be inferred).

The energy content of natural gas can be determined by inference frommeasurements of directly measurable parameters. Such techniques haveadvantages in that they might be capable of providing energy contentdata sufficient to meet the monitor and transfer needs without the costand other difficulties associated with GC measurements. An algorithmicinference method for estimating natural gas energy content generallyrelies on data correlations that relate energy measurement properties,such as for example molecular weight, mass-based heating value, standarddensity, molar ideal gross heating value, standard volumetric heatingvalue, density, volume-based heating value, and the like, to inferentialproperties such as velocity of sound, carbon dioxide concentration, andnitrogen concentration. Temperature and pressure of the gas can bemeasured and used to calculate the gas component concentrations on amass per volume basis. Data correlations can be used in conjunction withthe measured variables to convert existing flow meters, such as forexample ultrasonic, orifice, turbine, rotary, Coriolis, diaphragm, andthe like for use in on-line energy measurement. Example algorithms anddevices for conducting such measurements can be found in one or more ofU.S. Pat. Nos. 7,197,403, 6,850,847, 6,704,660, and 6,604,051, thecontents of all of which are hereby fully incorporated by reference.

While direct determination of the N₂ content of gas stream might bedesirable, N₂ lacks readily measurable IR absorption characteristics, soTDLAS measurements can be difficult. Other methods for detecting N₂ areavailable but may not be feasible for the natural gas industry due tothe hazardous nature of the environment, complexity of the measurementsystem and the associated costs. Two potential approaches includeconverting N₂ into NO using a plasma burner and then determining theconcentration of NO using chemiluminescence and using flame ionizationdetection or plasma emission detection. Both techniques are hazardousand expensive in the natural gas distribution industry.

In addition to nitrogen and carbon dioxide, natural gas also typicallyincludes methane (C₂H₄), ethane (C₂H₆), propane (C₃H₈), iso-butane (iC₄)and n-butane (nC₄), iso-pentane (iC₅) and n-pentane (nC₅), n-hexane(nC₆), n-heptane (nC₇), n-octane (nC₈), n-nonane (nC₉), n-decane (nC₁₀),hydrogen (H2), hydrogen sulfide (H₂S), oxygen (O₂), water (H₂O), carbonmonoxide (CO), helium (He), and argon (Ar). In most natural gas streams,O₂, H₂O, CO, He, Ar, and H₂S are only found in trace amounts and do nothave any significant affect on the stream's energy properties.Therefore, they can typically be ignored in these types of measurements.Additional parameters necessary to fully and accurately characterize theenergy content of a natural gas mixture having a variable compositioninclude the speed of sound in the gas; temperature and pressure of thegas; and concentrations of components of the gas such as CO₂, N₂, andthe total number of hydrocarbons from C₂ to C₁₀. Measurement of thespeed of sound, the temperature, and the pressure can be made directlyby velocity of sound sensors. The CO₂ concentration can be measuredusing a spectroscopic technique, such as IR Tunable Diode LaserAbsorption Spectroscopy (TDLAS). Similarly, a spectroscopic techniquesuch as IR laser absorption spectroscopy can be used to measure thetotal hydrocarbon content of the natural gas stream. With a measurementof the total hydrocarbon content of the gas and all other significantgas components, it is possible to determine the N₂, the only remaininggas present, by subtraction. With all necessary measurements availablein real time, additional calculations can be made to estimate themolecular weight of the subject gas, which can then be used as the basisfor mass flow calculations, to determine the speed of sound at standardpressure and temperature, and finally, the various thermo-physicalcharacteristics of the gas including its heating value.

An algorithmic technique can be used to characterize the thermo-physicalproperties of natural gas hydrocarbon mixtures with a single inferentialproperty when the concentrations of the diluent gases (carbon dioxideand nitrogen) are known. The single inferential property can be thespeed of sound in the natural gas mixture as determined at a knownpressure and temperature. The speed of sound forms the necessary inputto the algorithms developed for the purpose of thermo-physical propertycomputation. An instrument can use such an algorithm in concert withdirect or indirect measurements of the necessary gas properties(temperature, pressure, and density) and diluent concentrations (e.g.,nitrogen and carbon dioxide) of hydrocarbon gas streams. The system thencomputes values for the thermo-physical properties of such streamsdirectly and without reliance on external databases. The energy flow,heating value and other related thermo-physical properties aredetermined using such an algorithm.

In some implementations of the current subject matter, gasconcentrations are measured or inferred from other direct measurementsto calculate energy content values that are sufficiently accurate to bepractical for the measurement and tariff transfer purposes in thenatural gas distribution industry. The concentration of the total of thehydrocarbon components of the gas (the majority of the gas mixture) canbe determined by a single simultaneous measurement of the entire C₁-C₁₀group of gases by TDLAS spectroscopy. This measurement can be used todetermine the amount of N₂ present in the stream, withoutdifferentiating the carbon-containing species.

FIG. 1 is a process flow diagram 100 showing a method of determining theenergy content of a gas stream. Measurements of pressure, temperature,and the velocity of sound in a gas stream are conducted at 102. Thesemeasurements can be made with an ultrasonic meter or other comparabledevice that can be used to determine, compute, or measure the density ofa gas. The speed of sound in the gas is determined at 104 based on themeasurements and fed as one input to a processor that also receivesmeasurements of carbon dioxide at 106 and total hydrocarbons at 110. Thecarbon dioxide measurement at 106 and/or the total hydrocarbonmeasurement at 110 can be accomplished using a spectrometer as describedin greater detail below. The three inputs are used to determine a carbondioxide and a nitrogen concentration in the gas stream at 112 based onan algorithm described in greater detail below. The algorithm calculatesgas density (ρ), heating value (H), effective molecular weight (MW), andideal gross heating value (H_(n)) at 114. These calculated values can beused to determine the gas heating value at standard conditions at 116.At 120, one or more of the measured and/or calculated values can beoutput to an external device, such as a display, a computer, a database,a hard copy, or the like.

Another implementation of the current subject matter is shown in FIG. 2.Gas from a pipeline 202 or other source of natural gas or similar gaswhose heating value is of interest can be diverted to a sensor systemvia an inlet tap 204 or other comparable device. Gas removed from thepipeline 202 can flow through a first sensor 206, a second sensor 210,and a third sensor 212. The first sensor 206 can be a spectroscopicsensor system configured to quantify carbon dioxide in the gas stream,and the second sensor 210 can be a second spectroscopic sensorconfigured to quantify total hydrocarbons in the gas stream. Both thefirst sensor 206 and the second sensor 210 can be laser absorptionspectrometers. The third sensor 212 can be an ultrasonic meter or otherdevice for determining the temperature and pressure of, and the velocityof sound in the diverted gas stream. The third sensor 212 need not be asingle device that calculates all three values, but can be a combinationof one or more sensors that provide the desired measurements.

A processor 214 can receive data signals from the first, second, andthird sensors, optionally via a data interface 216, such as for examplea analog to digital converter. The processor 214 can be associated withspectrometer control electronics 220 and a system memory 222 which canstore the calculation algorithm and/or one or more processor routines aswell as software for operating the first, second and third sensors. Thespectrometer control electronics 220, which can control the first 206and the second 210 sensors, can be implemented on one or more secondprocessors or can alternatively be integrated with the processor 214.The processor 214, spectrometer control electronics 220, memory 222,data interface 216, and the like can be contained within a processorenclosure 224. A digital and/or analog input/output device 226 forpassing data to one or more external devices and for receiving inputcommands for the sensor system can be included, as can a user interface230. The algorithm can in one example by the MPX algorithm developed byIntegrated Information Technologies, Inc. (now SpectraSensors, Inc. ofRancho Cucamonga, Calif.). The sensor system can also include means forsample conditioning and pipeline extraction to facilitate installationin natural gas pipeline situations.

IR absorption spectrometers can be used to measure concentrations ofgases as to the measurement of gas concentrations in combination withthe measurement of pressure, temperature and velocity of sound (VOS)from the USM. The first sensor 206 for measuring CO₂ can optionally be aTDLAS spectrometer. The length of the path in the first sensor 206 canbe selected based on the strength of the absorption line being employed.In general, the stronger the absorbance, the shorter the path. For shortpaths, the light source (a tunable diode laser) and the detector can beplaced at opposite ends of the absorption path. When the path needs tobe longer the laser and the detector can be located at the same end ofthe path with a mirror at the opposite end. In this manner, the lighttraverses the “cell” length twice. When even longer cell are required, aHerriott cell, that allows the light to traverse between two concavespherical mirrors many times, can be employed. Herriott cells with pathlengths of 100 M or greater can be employed in these types ofmeasurements. Other types of optical cells that employ more complextechnology can have effective path lengths of several thousand meters bycausing a path length between the light source and the photodetector totraverse a sampled volume of gas many times.

For CO₂ and the wavelengths in the range of 1300 to 2100 nm, a harmonicspectroscopy technique can be employed in connection with its TDL lightsource to greatly improve the signal to noise of the spectrometer. TheTDL laser light source wavelength can be modulated at a high frequency(kHz-MHz) and the detection of the signal can be performed at a multipleof the modulation frequency. If the detection is performed at twice themodulation frequency, the term second harmonic or “2f” spectroscopy isused. Advantages to this technique include the minimization of 1/fnoise, and the removal of the sloping baseline that can be present onTDL spectra (due to the fact that the laser output power increases asthe laser injection current increases, and changing the laser injectioncurrent is how the laser is tuned).

A combination of a slow ramp and a fast sinusoidal modulation of thewavelength can be used to drive the diode laser. The photodetector inthe spectrometer can receive this modulated intensity signal. The n^(th)harmonic component can be resolved by demodulating the received signal.Detection using the signal at the second harmonic (2f) can be used. The2f lineshape is nearly symmetric and peaks at line center due to thenature of even function. Additionally, the second harmonic (2f) providesthe strongest signal of the even-numbered harmonics. By shiftingdetection to higher frequency, 2f spectroscopy can significantly reduce1/f noise and thus provide a substantial sensitivity enhancementcompared to direct absorption methods.

In another implementation, direct absorption spectroscopy can be used toquantify carbon dioxide. In this implementation, the frequency of thelaser source in the spectrometer can be tuned over the selectedabsorption transition and the zero-absorption baseline can be obtainedby fitting the regions outside the absorption line to a low-orderpolynomial. The integrated absorbance is directly proportional to theconcentrations of absorbing species in the laser path length as well asthe line strength of the transition.

The choice of photodetectors used in the first sensor can depend on thespecific wavelengths of the lasers and absorption lines to be measured.One possible photodetector is an indium gallium arsenide (InGaAs)photodiode sensitive to light in the 1200 to 2600 nm wavelength region.For longer wavelengths, an indium arsenide photodiode, sensitive forwavelengths up to approximately 3.6 μm, can be used. Alternatively,indium antimonide detectors are currently available for wavelengths aslong as approximately 5.5 μm. Both of the indium devices operate in aphotovoltaic mode and do not require a bias current for operation. Thesephotodetectors, which lack low frequency noise, are advantageous for DCor low frequency applications. Such detectors are also advantageous forhigh speed pulse laser detection, making them particularly useful intrace gas absorption spectroscopy. Other photodetectors, such as forexample indium arsenide (InAs), silicon (Si), or germanium (Ge)photodiodes and mercury-cadmium-telluride (MCT) and lead-sulfide (PbS)detectors, may also be used.

The signal from the first sensor 206 can be developed and recorded bythe processor 214 four times per second or at some other acceptableinterval. The processor 214 can determine the concentration of carbondioxide in the gas stream by computing the absorbance of the gas as aratio between the zero and the measured value of absorbance at the peakof the absorbance line. This absorbance is a function of the gaspressure and temperature in the cell so the absorbance is adjusted by apressure/temperature calibration matrix stored in the microprocessormemory. This matrix can be developed on an analyzer-by-analyzer basis.

Once the corrected absorbance value is determined, the concentration canbe computed from the Beer-Lambert law, which states that the amount oflight at a specific wavelength transmitted through a known length ofoptical path containing a target gas is proportional to theconcentration of the gas species that absorbs at that wavelength oflight:C=A/εL  (1)where C is the concentration, A is the absorption, ε is the extinctioncoefficient for the gas of interest and L is the path length of theabsorption/sample cell. This concentration can be converted into ppmv,lbs/mmscf averaged and sent to the outputs once per second.

As noted above, the second sensor 210 can provide a measurement of thetotal hydrocarbon content in the natural gas stream using spectroscopictechniques. The total hydrocarbon concentration, in conjunction with theknown carbon dioxide concentration, can then be used to determine thenitrogen concentration by difference. Given the concentrations ofhydrocarbons and carbon dioxide, it can be assumed in someimplementations that the remainder of the gas composition is nitrogen orother similarly inert gas species. The nitrogen concentration is thefifth gas characteristic used to determine the thermo-physicalproperties of the gas.

In one implementation, a fixed-wavelength TDL or NDIR approach canoptionally be used to measure the mole fraction of total hydrocarbons inthe gas stream. This technique can make use of two channels: one fixedat a selected wavelength to measure the total absorbance of the HCs andthe other providing a zero-absorption baseline/reference. The baselineor reference signal can be obtained in one of a number of possible ways.In one variation, the necessary spectroscopic data can be obtained byswitching the gas introduced into the absorption cell of the thirdsensor at regular intervals (switching interval is adjustable dependingon the stability of the background gas). The sample cell can be flushedwith an inert gas such as N₂ or air and the transmission signal with thesame laser and detector giving the background absorbance. Switching itback to the pipeline gas mixture will allow the difference to beobtained amounting to a measure of the total HC concentration.

In another variation, two laser beams can be multiplexed. One of thelaser beams can be a non-resonant laser beam (running at a wavelengthwhere all the HC's have negligible absorptions) that provides abackground measurement. This laser uses the same path or cell as thelaser that is making the HC concentration determination. The advantageof using a non-resonant laser wavelength is that it is able to accountfor the non-absorbing transmission loss. This can be a more costlysolution because it requires two lasers, at least one wavelength beamsplitting element (a grating, polarizing beam splitter or thin film beamsplitter) and two separate detectors. It is possible to accomplish asimilar effect using temporal multiplexing techniques which eliminatesome of the expense. However, two lasers are still generally used unlessthe resonant and non-resonant wavelengths are close enough to be coveredby one laser, along with one detector.

In yet another variation, a ratiometric technique can be employed inwhich a single wavelength laser beam is split into two parts. One partof the laser beam is passed through a measurement path or cell and thesecond through another identical path or cell with inert gas or directlyto detector. While this is an improvement to the two laser, two detectorsolution, it is unable to completely account for the non-absorbingtransmission loss along the main sample cell.

FIG. 3 shows a flow diagram 300 of an algorithm for inferentialcomputational measurement of energy flow in a natural gas pipeline. Asindicated above, the known parameters, including pressure, temperature,and the speed of sound, as well as concentrations of the dilutecomponents of pipeline gas are inputs to the algorithm. Using the speedof sound with known pressure, temperature, CO₂, and N₂ concentrations,the density of the subject gas can be determined. Additionalcalculations, such as for example using the density and a set ofreference gases, can be performed to determine the thermo-physicalcharacteristics of the gas.

Flow of natural gas can be measured as a volumetric flow rate (forexample by an ultrasonic meter, turbine meter, rotary meter, diaphragmmeter, or the like), on a differential basis (for example with anorifice meter, and annular meter, a V-cone meter, or the like) or as amass flow rate (for example using a Coriolis meter, thermal-mass meter,or the like). For a volumetric flow rate at a given temperature, Q_(v),the energy content flow rate, Q_(energy), is given by

$\begin{matrix}\begin{matrix}{Q_{energy} = {Q_{v,{std}} \cdot H_{v,{std}}}} \\{= {\left( \frac{\rho \cdot Q_{v}}{\rho_{std}} \right)\left( {\rho_{std} \cdot H_{m}} \right)}} \\{= {Q_{v}\left( {\rho \cdot H_{m}} \right)}} \\{= {Q_{v} \cdot H_{v}}}\end{matrix} & (2)\end{matrix}$where H^(v) is the volumetric energy content (energy per volume), ρ isthe gas density, H_(m) is the mass-based energy content (energy permass), and the subscript std denotes values determined at standardconditions of 60° F. (15.5° C.) and 14.696 psia (0.1013 MPa).

For differential flow meters, which are based on pressure measurements,Q_(energy), is given by

$\begin{matrix}\begin{matrix}{Q_{energy} = {Q_{v,{std}} \cdot H_{v,{std}}}} \\{= {\left( \frac{C \cdot \sqrt{\rho}}{\rho_{std}} \right)\left( {\rho_{std} \cdot H_{m}} \right)}} \\{= {C\left( {\sqrt{\rho} \cdot H_{m}} \right)}}\end{matrix} & (3)\end{matrix}$where C is a correction factor that depends on the gas viscosity and theisentropic exponent. The energy content flow for mass-based measurementsis given by

$\begin{matrix}\begin{matrix}{Q_{energy} = {Q_{v,{std}} \cdot H_{v,{std}}}} \\{= {\left( \frac{Q_{m}}{\rho_{std}} \right)\left( {\rho_{std} \cdot H_{m}} \right)}} \\{= {Q_{m}H_{m}}}\end{matrix} & (4)\end{matrix}$which depends only on the mass-based gas flow rate, Q_(m), multiplied bythe mass-based heating value, H_(m).

As indicated by equations 2-4, three main values are needed to calculatethe heating value for a sample of natural gas, two chemical properties:H_(m), ρ_(std), and one thermodynamic property: ρ. Other chemicalvalues, such as the mixture molecular weight, MW (mass per mol), themixture molar ideal gross heating value, H_(n,ref) (energy per mol, withchemical enthalpies referenced to standard conditions). MW can be usedas a data correlation intermediary to characterize gas composition andmay also be used to calculate the ideal specific gravity of a gasmixture. H_(n,ref) can be used as a data correlation intermediary tocharacterize gas composition, especially the gas density, ρ from anexisting equation of state.

H_(m), ρ_(std), MW, and H_(n,ref) can be calculated for a gas mixtureusing the equations shown below, and the measured inputs of gastemperature, pressure, speed of sound, mole fraction of CO₂, and molefraction of N₂, which can be determined using the total hydrocarbonconcentration, as discussed above.

The real gas state equation can be used to define the standard density,ρ_(std), as

$\begin{matrix}{\rho_{std} = \frac{{P_{std} \cdot M}\; W}{Z \cdot R \cdot T_{std}}} & (5)\end{matrix}$where P_(std) and T_(std) are standard pressure and temperature inabsolute units, Z is the compressibility factor, and R is the universalgas constant. Since P_(std), T_(std), and R are all constants, ρ_(std)is a function of only the variable ratio MW/Z. Then, algorithms can beemployed to calculate the heating value or energy content of the gas. Inone example, the algorithm as described in one or more of U.S. Pat. Nos.7,197,403, 6,850,847, 6,704,660, and 6,604,051, the disclosures of whichare incorporated herein by reference. The currently disclosed subjectmatter can be use din conjunction with such algorithms without the needfor inferring the input values used in the algorithms. Instead, theinput values are determined by direct measurement or, in the case of thenitrogen concentration, by mathematical derivation from one or moredirect measurements.

Table 1 shows common natural gas pipeline gas components and thetypical, although approximate, relative mole fractions of the variousspecies. As can be seen, methane is the dominant HC component in naturalgases (generally >80%). C₁-C₄ are usually found in the parts per hundredrange while C₆₊ is usually less than 1% as are iso-pentane andn-pentane.

TABLE 1 Typical Pipeline Gas Composition Component Mole Fraction Methane(CH₄) 70-96% Ethane (C₂H₆)  0-20% Propane (C₃H₈)  0-20% Butane (C₄H₁₀) 0-20% Pentane (C₅)   0-0.14% Hexanes+ (C₆+)   0-0.04% Carbon Dioxide(CO₂) 0-8% Oxygen (O₂)   0-0.2% Nitrogen (N₂) 0-5% Hydrogen (H₂)  0-0.02% Hydrogen Sulfide (H₂S) 0-5% T-Butyl Mercaptan (C₄H₁₀S) 0-50ppm Methyl Ethyl Sulfide (C₂H₆S)  0-5 ppm Rare gases (A, He, Ne, Xe)Trace

Table 2 lists candidate wavelengths for use in determination of thetotal hydrocarbon concentration. The wavelengths in Table 2 have beenselected based on C₁-C₁₀ hydrocarbons having similar levels ofabsorbance and the following two criteria being met: the totalabsorbance for all 12 HC's in an absorption cell of at least 10 cm inpath length is within 0.01% and 10.0%, and the standard deviation ofthese 12 absorbances at a given wavelength is less than approximately11%.

TABLE 2 Candidate Wavelengths for Total Hydrocarbon MeasurementFrequency Wavelength Total (cm⁻¹) (nm) Absorbance STD (%) 4394.032275.82 0.42 10.6 4404.69 2270.31 0.42 9.0 4408.55 2268.32 0.43 10.04420.66 2262.10 0.35 10.8 4422.23 2261.30 0.33 10.4 4422.53 2261.15 0.339.4 4422.83 2260.99 0.32 10.5 4423.08 2260.87 0.32 10.7 4423.14 2260.840.31 10.6 4424.16 2260.32 0.30 11.0 4424.70 2260.04 0.29 10.7 5903.001694.05 0.17 10.9 5903.12 1694.02 0.16 11.7

The lines at 2270.31 nm and 2261.15 nm listed in Table 2 have the beststandard deviation among the hydrocarbons as shown in the right column.However, both of these lines also occur on the edge of large CH₄spectral features as illustrated in FIG. 4 and FIG. 5. Interference frommethane absorption lines can lead to the measurement uncertainty for thetotal HC measurement being quite large due to the steep slope of themethane spectra at these wavelengths, especially in the natural gas inwhich where methane is the dominant component (generally >80%). Underthese circumstances, other candidate wavelengths listed in Table 2 andshown in FIGS. 4-7 may be more amenable to higher accuracy determinationof the total HC concentration.

In an alternative implementation, the CH₄ concentration in a gas streamcan be measured independently using TDLAS, and the total percentage ofhigher molecular weight hydrocarbons can be determined using absorptionmeasurements at another wavelength at which these larger hydrocarbonmolecules have similar levels of absorption and are not subject to CH₄interference. This approach can be effective at least because CH₄spectra tend to be more structured than the higher molecular weighthydrocarbons, which have a greater number of inter-atomic bonds andassociated vibrational and rotational degrees of freedom that can bestimulated by absorption of an infrared photon. The lower structure ofthe higher molecular weight hydrocarbons facilitates theirdifferentiation from methane absorption lines. Table 3 lists wavelengthswhere C₂-C₁₀ have similar levels of absorbance to methane and thatsatisfy the following criteria: the total absorbance for a total molefraction of 10% of all 11 HC's and an absorption cell of at least 10 cmpath length is within a range of approximately 0.01-10.0, the standarddeviation of these 11 absorbances at a given wavelength is less thanapproximately 20%, and the absorbance for a 90% mole fraction of CH₄ isless than approximately 1% of the total absorbance for a 10% molefraction of all C₂-C₁₀ absorptions at the same path length.

As listed in Table 3, the useful wavelengths tend to be located in themid-infrared region where the use of quantum cascade lasers may beadvantageous due to the current lack of semiconductor diode lasersavailable at these wavelengths.

TABLE 3 Candidate Wavelengths for Total HC Measurement Without CH₄Frequency Wavelength C2-C10 Absorbance Ratio - (cm⁻¹) (nm) AbsorbanceSTD (%) C1/[C2-C10] (%) 3244.70 3081.95 0.019 18.5 1.0 3244.40 3082.230.019 17.8 0.9 3244.34 3082.29 0.019 17.7 0.7 3244.28 3082.35 0.019 18.10.6 3244.22 3082.40 0.019 16.3 0.6 3244.16 3082.46 0.019 16.8 0.73244.10 3082.52 0.019 16.8 0.8 3242.78 3083.78 0.021 16.1 0.9 3242.723083.84 0.020 15.1 0.9 3242.65 3083.89 0.020 15.7 1.0 3241.99 3084.520.020 18.1 1.0 3241.93 3084.58 0.020 17.3 0.8 3241.87 3084.64 0.020 17.40.7 3241.81 3084.70 0.021 17.9 0.7 3241.75 3084.75 0.021 16.9 0.73241.69 3084.81 0.021 16.4 0.8 3241.63 3084.87 0.021 15.7 0.9 3241.573084.93 0.021 15.9 0.9 3241.39 3085.10 0.021 17.4 1.0 3241.33 3085.150.021 18.1 0.9 3241.27 3085.21 0.021 18.7 0.9 3239.22 3087.16 0.022 18.21.0 3239.16 3087.22 0.023 17.0 0.9 3239.10 3087.28 0.023 17.7 0.93239.04 3087.34 0.023 17.7 0.9 1488.53 6718.02 0.398 19.5 0.6 1488.356718.83 0.395 19.2 0.4 1485.58 6731.37 0.492 14.1 0.8 1485.52 6731.640.498 13.5 0.7 1485.46 6731.92 0.488 15.9 0.8

Various implementations of the subject matter described herein may berealized in digital electronic circuitry, integrated circuitry,specially designed ASICs (application specific integrated circuits),computer hardware, firmware, software, and/or combinations thereof.These various implementations may include implementation in one or morecomputer programs that are executable and/or interpretable on aprogrammable system including at least one programmable processor, whichmay be special or general purpose, coupled to receive data andinstructions from, and to transmit data and instructions to, a storagesystem, at least one input device, and at least one output device.

These computer programs (also known as programs, software, softwareapplications or code) include machine instructions for a programmableprocessor, and may be implemented in a high-level procedural and/orobject-oriented programming language, and/or in assembly/machinelanguage. As used herein, the term “machine-readable medium” refers toany computer program product, apparatus and/or device (e.g., magneticdiscs, optical disks, memory, Programmable Logic Devices (PLDs)) used toprovide machine instructions and/or data to a programmable processor,including a machine-readable medium that receives machine instructionsas a machine-readable instructions and/or data to a programmableprocessor. signal. The term “machine-readable signal” refers to anysignal used to provide machine

The computing system may include clients and servers. A client andserver are generally remote from each other and typically interactthrough a communication network. The relationship of client and serverarises by virtue of computer programs running on the respectivecomputers and having a client-server relationship to each other.

The subject matter described herein may be embodied in systems,apparatus, methods, and/or articles depending on the desiredconfiguration. Although a few variations have been described in detailabove, other modifications, additions, and implementations are possibleare within the scope and spirit of the disclosed subject matter.Features implementing functions may also be physically located atvarious positions, including being distributed such that portions offunctions are implemented at different physical locations. Furtherfeatures and/or variations may be provided in addition to those setforth herein. For example, the implementations described above may bedirected to various combinations and subcombinations of the disclosedfeatures and/or combinations and subcombinations of several furtherfeatures disclosed above. In addition, the logic flow depicted in theaccompanying figures and/or described herein does not require theparticular order shown, or sequential order, to achieve desirableresults.

1. An apparatus comprising: a first sensor producing a first data signalcharacterizing a carbon dioxide concentration in the gas stream, thefirst sensor comprising a tunable diode laser absorption spectrometercomprising a laser light source that is modulated at a modulationfrequency while being scanned over a wavelength range that includes aselected absorption transition for carbon dioxide and a detector thatdetects an intensity of light reaching the detector at a multiple of themodulation frequency after light from the laser light source passesthrough the gas stream, the first data signal comprising the intensityas a function of wavelength at the multiple of the modulation frequency;and a master processor that receives the first data signal andmeasurements of pressure and temperature in the gas stream, the masterprocessor performing operations comprising: demodulating the intensityas a function of wavelength at the multiple of the modulation frequencyreceived in the first data signal to remove a sloping baseline caused bythe scanning of the laser light source over the wavelength range and tocalculate the carbon dioxide concentration in the gas stream based on asignal strength of the demodulated intensity at the selected absorptiontransitions; calculating a total nitrogen and inert speciesconcentration in the gas stream as a remainder when the calculatedcarbon dioxide concentration and an inferred total hydrocarbonconcentration are subtracted from 100%, the inferred total hydrocarbonconcentration in the gas stream being based on a database ofcharacteristic natural gas concentrations; and implementing an algorithmthat determines an energy content of the gas stream using as inputs themeasured temperature, the measured pressure, the carbon dioxideconcentration, and the calculated total nitrogen and inert speciesconcentration.
 2. An apparatus as in claim 1, further comprising one ormore connections configured to attach to a fitting on a gas pipeline todivert the sample gas stream from the gas pipeline to the first sensor.3. An apparatus as in claim 1, wherein the selected absorptiontransition for carbon dioxide is between approximately 2003 and 2004 nm.4. An apparatus as in claim 1, further comprising one or moreconnections configured to attach to a fitting on a gas pipeline todivert the sample gas stream from the gas pipeline to the first sensor.5. An apparatus as in claim 1, wherein the wavelength range is betweenapproximately 1300 nm and 2100 nm.
 6. An apparatus as in claim 1,wherein the detector comprises at least one of an indium galliumarsenide (InGaAs) photodiode, an indium arsenide photodiode, an indiumantimonide detector, an indium arsenide (InAs) photodetector, a silicon(Si) photodetector, a germanium (Ge) photodiode, amercury-cadmium-telluride (MCT) detector, and a lead-sulfide (PbS)detector.
 7. A computer-implemented method comprising: receiving a firstdata signal characterizing a carbon dioxide concentration in a gasstream, the first data signal comprising a light intensity as a functionof wavelength at a multiple of a modulation frequency, the modulationfrequency being imposed on a laser light source of a tunable diode laserabsorption spectrometer as the laser light source is scanned over awavelength range that includes a selected absorption transition forcarbon dioxide; demodulating the intensity as a function of wavelengthat the multiple of the modulation frequency to remove a sloping baselinecaused by the scanning of the laser light source over the wavelengthrange and to calculate the carbon dioxide concentration in the gasstream based on a signal strength of the demodulated intensity at theselected absorption transition; receiving measurements of pressure andtemperature in the gas stream; calculating a total nitrogen and inertspecies concentration in the gas stream as a remainder when thecalculated carbon dioxide concentration and an inferred totalhydrocarbon concentration are subtracted from 100%, the inferred totalhydrocarbon concentration in the gas stream being based on a database ofcharacteristic natural gas concentrations; and implementing an algorithmthat determines an energy content of the gas stream using as inputs thereceived measurements of temperature and pressure, the calculated carbondioxide concentration, and the calculated total nitrogen and inertspecies concentration.
 8. A method as in claim 7, further comprisingproducing the first signal using the tunable diode laser absorptionspectrometer.
 9. A method as in claim 8, wherein the producing the firstsignal further comprises modulating the laser light source at themodulation frequency and detecting the light intensity as the functionof wavelength at the multiple of a modulation frequency using adetector.
 10. A method as in claim 7, wherein the selected absorptiontransition for carbon dioxide is between approximately 2003 and 2004 nm.11. A method as in claim 7, wherein the wavelength range is betweenapproximately 1300 nm and 2100 nm.
 12. A method as in claim 7, whereinthe light intensity is measured by a detector of the first sensor, thedetector comprising at least one of an indium gallium arsenide (InGaAs)photodiode, an indium arsenide photodiode, an indium antimonidedetector, an indium arsenide (InAs) photodetector, a silicon (Si)photodetector, a germanium (Ge) photodiode, a mercury-cadmium-telluride(MCI) detector, and a lead-sulfide (PbS) detector.
 13. A computerprogram product comprising a non-transitory machine-readable mediumstoring instructions that, when executed by at least one programmableprocessor, cause the at least one programmable processor to performoperations comprising: receiving a first data signal characterizing acarbon dioxide concentration in a gas stream, the first data signalcomprising a light intensity as a function of wavelength at a multipleof a modulation frequency, the modulation frequency being imposed on alaser light source of a tunable diode laser absorption spectrometer asthe laser light source is scanned over a wavelength range that includesa selected absorption transition for carbon dioxide; demodulating theintensity as a function of wavelength at the multiple of the modulationfrequency to remove a sloping baseline caused by the scanning of thelaser light source over the wavelength range and to calculate the carbondioxide concentration in the gas stream based on a signal strength ofthe demodulated intensity at the selected absorption transition;receiving measurements of pressure and temperature in the gas stream;calculating a total nitrogen and inert species concentration in the gasstream as a remainder when the calculated carbon dioxide concentrationand an inferred total hydrocarbon concentration are subtracted from100%, the inferred total hydrocarbon concentration in the gas streambeing based on a database of characteristic natural gas concentrations;and implementing an algorithm that determines an energy content of thegas stream using as inputs the received measurements of temperature andpressure, the calculated carbon dioxide concentration, and thecalculated total nitrogen and inert species concentration.
 14. Acomputer program product as in claim 13, further comprising producingthe first signal using the tunable diode laser absorption spectrometer.15. A computer program product as in claim 14, wherein the producing thefirst signal further comprises modulating the laser light source at themodulation frequency and detecting the light intensity as the functionof wavelength at the multiple of a modulation frequency using adetector.
 16. A computer program product as in claim 13, wherein thewavelength range is between approximately 1300 nm and 2100 nm.
 17. Acomputer program product as in claim 13, wherein the light intensity ismeasured by a detector of the first sensor, the detector comprising atleast one of an indium gallium arsenide (InGaAs) photodiode, an indiumarsenide photodiode, an indium antimonide detector, an indium arsenide(InAs) photodetector, a silicon (Si) photodetector, a germanium (Ge)photodiode, a mercury-cadmium-telluride (MCT) detector, and alead-sulfide (PbS) detector.